<script lang="tsx">
import { compile } from 'vue'
export default defineComponent({
  props: {
    iconName: String
  },
  setup(props) {
    if (props.iconName?.startsWith('iconfont')) {
      return () => h(<i />, { class: props.iconName })
    } else {
      const icon = h(compile(`<${props.iconName} />`))
      return () => icon
    }
  }
})
</script>
<style scoped></style>
